package com.showgood.config {
	import com.showgood.view.*;
	import com.showgood.view.mediator.*;
	import com.showgood.view.component.*;
	/**
	 * 
	 * @author BianPeng
	 */
	public class PopupConfig {
		private var _cls:Class;		// the class of topwindow
		private var _mcls:Class;	// the class of the mediator
		private var _privilege:int;
		private var _modal:Boolean;
		
		public function PopupConfig(cls:Class,mcls:Class,privilege:int,modal:Boolean) {
			_cls = cls;
			_mcls = mcls;
			_privilege = privilege;
			_modal = modal;
		}
		public function get cls():Class { return _cls; }
		public function get mcls():Class { return _mcls; }
		public function get privilege():int { return _privilege; }
		public function get modal():Boolean { return _modal; }
		
		////////////////////////////////////////////////////
		// static part
		////////////////////////////////////////////////////
		private static var _config:Vector.<PopupConfig> ;
		public static function config(id:int): PopupConfig {
			if (_config == null) {
				_config = new Vector.<PopupConfig>();
				_config.push(new PopupConfig(LoginDialog, LoginDialogMediator, 100, true));
				_config.push(new PopupConfig(CityDialog, CityDialogMediator, 90, false));
				_config.push(new PopupConfig(ChuZhengDialog, ChuZhengDialogMediator, 80, false));
				_config.push(new PopupConfig(FirmSlidder, FirmSlidderMediator, 70, false));
			}
			return _config[id];
		}
		
		// config id
		public static const LOGIN_DIALOG:int = 0;
		public static const CITY_DIALOG:int = 1;
		public static const CHUZHENG_DIALOG:int = 2;
		public static const FIRM_SLIDDER:int = 3;
		
		// privilege
		public static const ALL_WINDOW:int = 9999;
	}

}

